import { Component, OnInit } from '@angular/core';

import { HttpClient } from '@angular/common/http';

@Component({
  selector: 'app-carousel',
  templateUrl: './carousel.component.html',
  styleUrls: ['./carousel.component.sass']
})
export class CarouselComponent implements OnInit {

  carousels: any;

  constructor(private http: HttpClient) { }

  ngOnInit() {

    this.http.get(`/papi/carousel/position/1`).subscribe(carousels => this.carousels = carousels);
  }

  /**
   * 图片转变, 根据图片主体色调改变背景
   * @param from before
   * @param to after
   */
  carouselAfterChange({ from, to }) {
  }
}
